<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Box Model</title>
    <style>
        div.ex {
            width: 330px;
            padding: 20px;
            border: 5px solid slategray;
            margin: 10px;
        }
    </style>
</head>

<body>

    <div class="ex">这个元素总宽度是 400px ，宽度是 330px ，填充是 20px ，边框是 5px ，边距是 10px 。</div>

</body>

</html>